package com.zh.note.huawei.twohundred.数字加减游戏;

/**
 * @Author: zhanghuan
 * @date: 2023/8/14 16:49
 * @description: create it
 */
public class Main {
    public static void main(String[] args) {
        // Scanner sc = new Scanner(System.in);
        // int s = sc.nextInt();
        // int t = sc.nextInt();
        // int a = sc.nextInt();
        // int b = sc.nextInt();
        int s = 1;
        int t = 10;
        int a = 5;
        int b = 2;
        if (a == b) {
            System.out.println("input error");
            return;
        }
        int dis = Math.abs(s - t);
        int temp1 = dis;
        int temp2 = dis;
        int firstCount = 0;
        int secondCount = 0;
        while (temp1 % b != 0) {
            temp1 -= a;
            firstCount++;
        }
        while (temp2 % b != 0) {
            temp2 += a;
            secondCount++;
        }
        System.out.println(Math.min(firstCount, secondCount));


    }
}
